package com.platform.module.common.exception;


import com.platform.module.common.base.CodeDict;

public class NoLoginException extends RuntimeException {
    private String code;
    private Object data;

    public NoLoginException() {
        super("请先登录再访问");
        this.code = CodeDict.未登录.getCode();
    }

    public NoLoginException(String message) {
        super(message);
        this.code = "1";
    }

    public NoLoginException(String code, String message) {
        super(message);
        this.code = code;
    }

    public NoLoginException(String code, String message, Object data) {
        super(message);
        this.code = code;
        this.data = data;
    }

    public NoLoginException(String message, Throwable cause) {
        super(message, cause);
        this.code = CodeDict.FAILED.getCode();
    }

    public NoLoginException(Throwable cause) {
        super(cause);
        this.code = CodeDict.FAILED.getCode();
    }

    public NoLoginException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.code = CodeDict.FAILED.getCode();
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Object getData() {
        return this.data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
